﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Castle.ActiveRecord;
using ZDSoft.UPMS.Core;
using ZDSoft.UPMS.Service.SystemPart;
using ZDSoft.UPMS.Component.SystemPart;
using System.IO;
using System.Text;

namespace ZDSoft.UPMS.Web
{
    public partial class CreateDB : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            ActiveRecordStarter.CreateSchema();

            SystemSettingComponent SystemSettingComponent = new SystemSettingComponent();
            SystemSettingComponent.CreateData();
            Declear();
            Response.Write("<script>alert('创建成功！')</script>");
        }


        private void Declear()
        {
            string Path = Server.MapPath("/Content/tab/Code.txt");
            StreamWriter sw = new StreamWriter(Path, false, Encoding.GetEncoding("GBK"));
            sw.WriteLine("");
        }
    }
}